const {insert} = require('../db.js')

const puppeteer = require('puppeteer')
const detail = require('../detail.js')

async function run() {
    const browser = await puppeteer.launch()
    const page = await browser.newPage()
    let info = await detail(page, '128138')
    await browser.close()
    //console.log(JSON.stringify(info.info))
    let result = await insert(info.convertible)
    console.log(result)
    process.exit(0)
}

run().catch(err => {
    console.log(err)
    process.exit(1)
})
